home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2002 #3 / Amiga Plus CD - 2002 - No. 03.iso / AmigaPlus / Tools / Development / renderlib40 / include / gccinline / render.h
Encoding:
C/C++ Source or Header  |  2003-02-02  |  15.1 KB  |  347 lines

  1. #ifndef _INLINE_RENDER_H
  2. #define _INLINE_RENDER_H
  3.  
  4. #ifndef __INLINE_MACROS_H
  5. #include <inline/macros.h>
  6. #endif
  7.  
  8. #ifndef RENDER_BASE_NAME
  9. #define RENDER_BASE_NAME RenderBase
  10. #endif
  11.  
  12. #define CreateRMHandlerA(taglist) \
  13.     LP1(0x2a, APTR, CreateRMHandlerA, struct TagItem *, taglist, a1, \
  14.     , RENDER_BASE_NAME)
  15.  
  16. #ifndef NO_INLINE_STDARG
  17. #define CreateRMHandler(tags...) \
  18.     ({ULONG _tags[] = {tags}; CreateRMHandlerA((struct TagItem *) _tags);})
  19. #endif
  20.  
  21. #define DeleteRMHandler(rmh) \
  22.     LP1NR(0x30, DeleteRMHandler, APTR, rmh, a0, \
  23.     , RENDER_BASE_NAME)
  24.  
  25. #define AllocRenderMem(rendermemhandler, size) \
  26.     LP2(0x36, APTR, AllocRenderMem, APTR, rendermemhandler, a0, ULONG, size, d0, \
  27.     , RENDER_BASE_NAME)
  28.  
  29. #define FreeRenderMem(rendermemhandler, mem, size) \
  30.     LP3NR(0x3c, FreeRenderMem, APTR, rendermemhandler, a0, APTR, mem, a1, ULONG, size, d0, \
  31.     , RENDER_BASE_NAME)
  32.  
  33. #define AllocRenderVec(rendermemhandler, size) \
  34.     LP2(0x42, APTR, AllocRenderVec, APTR, rendermemhandler, a0, ULONG, size, d0, \
  35.     , RENDER_BASE_NAME)
  36.  
  37. #define FreeRenderVec(mem) \
  38.     LP1NR(0x48, FreeRenderVec, APTR, mem, a0, \
  39.     , RENDER_BASE_NAME)
  40.  
  41. #define CreateHistogramA(taglist) \
  42.     LP1(0x4e, APTR, CreateHistogramA, struct TagItem *, taglist, a1, \
  43.     , RENDER_BASE_NAME)
  44.  
  45. #ifndef NO_INLINE_STDARG
  46. #define CreateHistogram(tags...) \
  47.     ({ULONG _tags[] = {tags}; CreateHistogramA((struct TagItem *) _tags);})
  48. #endif
  49.  
  50. #define DeleteHistogram(histogram) \
  51.     LP1NR(0x54, DeleteHistogram, APTR, histogram, a0, \
  52.     , RENDER_BASE_NAME)
  53.  
  54. #define QueryHistogram(histogram, tag) \
  55.     LP2(0x5a, ULONG, QueryHistogram, APTR, histogram, a0, Tag, tag, d0, \
  56.     , RENDER_BASE_NAME)
  57.  
  58. #define AddRGB(histogram, RGB, count) \
  59.     LP3(0x60, ULONG, AddRGB, APTR, histogram, a0, ULONG, RGB, d0, ULONG, count, d1, \
  60.     , RENDER_BASE_NAME)
  61.  
  62. #define AddRGBImageA(histogram, rgb, width, height, taglist) \
  63.     LP5(0x66, ULONG, AddRGBImageA, APTR, histogram, a0, ULONG *, rgb, a1, UWORD, width, d0, UWORD, height, d1, struct TagItem *, taglist, a2, \
  64.     , RENDER_BASE_NAME)
  65.  
  66. #ifndef NO_INLINE_STDARG
  67. #define AddRGBImage(histogram, rgb, width, height, tags...) \
  68.     ({ULONG _tags[] = {tags}; AddRGBImageA((histogram), (rgb), (width), (height), (struct TagItem *) _tags);})
  69. #endif
  70.  
  71. #define AddChunkyImageA(histogram, chunky, width, height, palette, taglist) \
  72.     LP6(0x6c, ULONG, AddChunkyImageA, APTR, histogram, a0, UBYTE *, chunky, a1, UWORD, width, d0, UWORD, height, d1, APTR, palette, a2, struct TagItem *, taglist, a3, \
  73.     , RENDER_BASE_NAME)
  74.  
  75. #ifndef NO_INLINE_STDARG
  76. #define AddChunkyImage(histogram, chunky, width, height, palette, tags...) \
  77.     ({ULONG _tags[] = {tags}; AddChunkyImageA((histogram), (chunky), (width), (height), (palette), (struct TagItem *) _tags);})
  78. #endif
  79.  
  80. #define ExtractPaletteA(histogram, palette, numcolors, taglist) \
  81.     LP4(0x72, ULONG, ExtractPaletteA, APTR, histogram, a0, ULONG *, palette, a1, UWORD, numcolors, d0, struct TagItem *, taglist, a2, \
  82.     , RENDER_BASE_NAME)
  83.  
  84. #ifndef NO_INLINE_STDARG
  85. #define ExtractPalette(histogram, palette, numcolors, tags...) \
  86.     ({ULONG _tags[] = {tags}; ExtractPaletteA((histogram), (palette), (numcolors), (struct TagItem *) _tags);})
  87. #endif
  88.  
  89. #define RenderA(rgb, width, height, chunky, palette, taglist) \
  90.     LP6(0x78, ULONG, RenderA, ULONG *, rgb, a0, UWORD, width, d0, UWORD, height, d1, UBYTE *, chunky, a1, APTR, palette, a2, struct TagItem *, taglist, a3, \
  91.     , RENDER_BASE_NAME)
  92.  
  93. #ifndef NO_INLINE_STDARG
  94. #define Render(rgb, width, height, chunky, palette, tags...) \
  95.     ({ULONG _tags[] = {tags}; RenderA((rgb), (width), (height), (chunky), (palette), (struct TagItem *) _tags);})
  96. #endif
  97.  
  98. #define Planar2ChunkyA(planetab, bytewidth, height, depth, bytesperrow, chunky, taglist) \
  99.     LP7NR(0x7e, Planar2ChunkyA, PLANEPTR *, planetab, a0, UWORD, bytewidth, d0, UWORD, height, d1, UWORD, depth, d2, UWORD, bytesperrow, d3, UBYTE *, chunky, a1, struct TagItem *, taglist, a2, \
  100.     , RENDER_BASE_NAME)
  101.  
  102. #ifndef NO_INLINE_STDARG
  103. #define Planar2Chunky(planetab, bytewidth, height, depth, bytesperrow, chunky, tags...) \
  104.     ({ULONG _tags[] = {tags}; Planar2ChunkyA((planetab), (bytewidth), (height), (depth), (bytesperrow), (chunky), (struct TagItem *) _tags);})
  105. #endif
  106.  
  107. #define Chunky2RGBA(chunky, width, height, rgb, palette, taglist) \
  108.     LP6(0x84, ULONG, Chunky2RGBA, UBYTE *, chunky, a0, UWORD, width, d0, UWORD, height, d1, ULONG *, rgb, a1, APTR, palette, a2, struct TagItem *, taglist, a3, \
  109.     , RENDER_BASE_NAME)
  110.  
  111. #ifndef NO_INLINE_STDARG
  112. #define Chunky2RGB(chunky, width, height, rgb, palette, tags...) \
  113.     ({ULONG _tags[] = {tags}; Chunky2RGBA((chunky), (width), (height), (rgb), (palette), (struct TagItem *) _tags);})
  114. #endif
  115.  
  116. #define Chunky2BitMapA(chunky, sx, sy, width, height, bitmap, dx, dy, taglist) \
  117.     LP9NR(0x8a, Chunky2BitMapA, UBYTE *, chunky, a0, UWORD, sx, d0, UWORD, sy, d1, UWORD, width, d2, UWORD, height, d3, struct BitMap *, bitmap, a1, UWORD, dx, d4, UWORD, dy, d5, struct TagItem *, taglist, a2, \
  118.     , RENDER_BASE_NAME)
  119.  
  120. #ifndef NO_INLINE_STDARG
  121. #define Chunky2BitMap(chunky, sx, sy, width, height, bitmap, dx, dy, tags...) \
  122.     ({ULONG _tags[] = {tags}; Chunky2BitMapA((chunky), (sx), (sy), (width), (height), (bitmap), (dx), (dy), (struct TagItem *) _tags);})
  123. #endif
  124.  
  125. #define CreateScaleEngineA(sourcewidth, sourceheight, destwidth, destheight, taglist) \
  126.     LP5(0x90, APTR, CreateScaleEngineA, UWORD, sourcewidth, d0, UWORD, sourceheight, d1, UWORD, destwidth, d2, UWORD, destheight, d3, struct TagItem *, taglist, a1, \
  127.     , RENDER_BASE_NAME)
  128.  
  129. #ifndef NO_INLINE_STDARG
  130. #define CreateScaleEngine(sourcewidth, sourceheight, destwidth, destheight, tags...) \
  131.     ({ULONG _tags[] = {tags}; CreateScaleEngineA((sourcewidth), (sourceheight), (destwidth), (destheight), (struct TagItem *) _tags);})
  132. #endif
  133.  
  134. #define DeleteScaleEngine(engine) \
  135.     LP1NR(0x96, DeleteScaleEngine, APTR, engine, a0, \
  136.     , RENDER_BASE_NAME)
  137.  
  138. #define ScaleA(engine, source, dest, taglist) \
  139.     LP4(0x9c, ULONG, ScaleA, APTR, engine, a0, APTR, source, a1, APTR, dest, a2, struct TagItem *, taglist, a3, \
  140.     , RENDER_BASE_NAME)
  141.  
  142. #ifndef NO_INLINE_STDARG
  143. #define Scale(engine, source, dest, tags...) \
  144.     ({ULONG _tags[] = {tags}; ScaleA((engine), (source), (dest), (struct TagItem *) _tags);})
  145. #endif
  146.  
  147. #define ConvertChunkyA(source, oldpalette, width, height, dest, newpalette, taglist) \
  148.     LP7A4(0xa2, ULONG, ConvertChunkyA, UBYTE *, source, a0, APTR, oldpalette, a1, UWORD, width, d0, UWORD, height, d1, UBYTE *, dest, a2, APTR, newpalette, a3, struct TagItem *, taglist, d7, \
  149.     , RENDER_BASE_NAME)
  150.  
  151. #ifndef NO_INLINE_STDARG
  152. #define ConvertChunky(source, oldpalette, width, height, dest, newpalette, tags...) \
  153.     ({ULONG _tags[] = {tags}; ConvertChunkyA((source), (oldpalette), (width), (height), (dest), (newpalette), (struct TagItem *) _tags);})
  154. #endif
  155.  
  156. #define CreatePenTableA(chunky, oldpalette, width, height, newpalette, convtab, taglist) \
  157.     LP7NRA4(0xa8, CreatePenTableA, UBYTE *, chunky, a0, APTR, oldpalette, a1, UWORD, width, d0, UWORD, height, d1, APTR, newpalette, a2, UBYTE *, convtab, a3, struct TagItem *, taglist, d7, \
  158.     , RENDER_BASE_NAME)
  159.  
  160. #ifndef NO_INLINE_STDARG
  161. #define CreatePenTable(chunky, oldpalette, width, height, newpalette, convtab, tags...) \
  162.     ({ULONG _tags[] = {tags}; CreatePenTableA((chunky), (oldpalette), (width), (height), (newpalette), (convtab), (struct TagItem *) _tags);})
  163. #endif
  164.  
  165. #define CreatePaletteA(taglist) \
  166.     LP1(0xae, APTR, CreatePaletteA, struct TagItem *, taglist, a1, \
  167.     , RENDER_BASE_NAME)
  168.  
  169. #ifndef NO_INLINE_STDARG
  170. #define CreatePalette(tags...) \
  171.     ({ULONG _tags[] = {tags}; CreatePaletteA((struct TagItem *) _tags);})
  172. #endif
  173.  
  174. #define DeletePalette(palette) \
  175.     LP1NR(0xb4, DeletePalette, APTR, palette, a0, \
  176.     , RENDER_BASE_NAME)
  177.  
  178. #define ImportPaletteA(palette, coltab, numcols, taglist) \
  179.     LP4NR(0xba, ImportPaletteA, APTR, palette, a0, APTR, coltab, a1, UWORD, numcols, d0, struct TagItem *, taglist, a2, \
  180.     , RENDER_BASE_NAME)
  181.  
  182. #ifndef NO_INLINE_STDARG
  183. #define ImportPalette(palette, coltab, numcols, tags...) \
  184.     ({ULONG _tags[] = {tags}; ImportPaletteA((palette), (coltab), (numcols), (struct TagItem *) _tags);})
  185. #endif
  186.  
  187. #define ExportPaletteA(palette, coltab, taglist) \
  188.     LP3NR(0xc0, ExportPaletteA, APTR, palette, a0, APTR, coltab, a1, struct TagItem *, taglist, a2, \
  189.     , RENDER_BASE_NAME)
  190.  
  191. #ifndef NO_INLINE_STDARG
  192. #define ExportPalette(palette, coltab, tags...) \
  193.     ({ULONG _tags[] = {tags}; ExportPaletteA((palette), (coltab), (struct TagItem *) _tags);})
  194. #endif
  195.  
  196. #define CountRGB(histogram, rgb) \
  197.     LP2(0xc6, ULONG, CountRGB, APTR, histogram, a0, ULONG, rgb, d0, \
  198.     , RENDER_BASE_NAME)
  199.  
  200. #define BestPen(palette, rgb) \
  201.     LP2(0xcc, LONG, BestPen, APTR, palette, a0, ULONG, rgb, d0, \
  202.     , RENDER_BASE_NAME)
  203.  
  204. #define FlushPalette(palette) \
  205.     LP1NR(0xd2, FlushPalette, APTR, palette, a0, \
  206.     , RENDER_BASE_NAME)
  207.  
  208. #define SortPaletteA(palette, mode, taglist) \
  209.     LP3(0xd8, ULONG, SortPaletteA, APTR, palette, a0, ULONG, mode, d0, struct TagItem *, taglist, a1, \
  210.     , RENDER_BASE_NAME)
  211.  
  212. #ifndef NO_INLINE_STDARG
  213. #define SortPalette(palette, mode, tags...) \
  214.     ({ULONG _tags[] = {tags}; SortPaletteA((palette), (mode), (struct TagItem *) _tags);})
  215. #endif
  216.  
  217. #define AddHistogramA(histogram1, histogram2, taglist) \
  218.     LP3(0xde, ULONG, AddHistogramA, APTR, histogram1, a0, APTR, histogram2, a1, struct TagItem *, taglist, a2, \
  219.     , RENDER_BASE_NAME)
  220.  
  221. #ifndef NO_INLINE_STDARG
  222. #define AddHistogram(histogram1, histogram2, tags...) \
  223.     ({ULONG _tags[] = {tags}; AddHistogramA((histogram1), (histogram2), (struct TagItem *) _tags);})
  224. #endif
  225.  
  226. #define ScaleOrdinate(source, dest, ordinate) \
  227.     LP3(0xe4, UWORD, ScaleOrdinate, UWORD, source, d0, UWORD, dest, d1, UWORD, ordinate, d2, \
  228.     , RENDER_BASE_NAME)
  229.  
  230. #define CreateMapEngineA(palette, taglist) \
  231.     LP2(0xf6, APTR, CreateMapEngineA, APTR, palette, a0, struct TagItem *, taglist, a1, \
  232.     , RENDER_BASE_NAME)
  233.  
  234. #ifndef NO_INLINE_STDARG
  235. #define CreateMapEngine(palette, tags...) \
  236.     ({ULONG _tags[] = {tags}; CreateMapEngineA((palette), (struct TagItem *) _tags);})
  237. #endif
  238.  
  239. #define DeleteMapEngine(engine) \
  240.     LP1NR(0xfc, DeleteMapEngine, APTR, engine, a0, \
  241.     , RENDER_BASE_NAME)
  242.  
  243. #define MapRGBArrayA(engine, rgb, width, height, chunky, taglist) \
  244.     LP6(0x102, ULONG, MapRGBArrayA, APTR, engine, a0, ULONG *, rgb, a1, UWORD, width, d0, UWORD, height, d1, UBYTE *, chunky, a2, struct TagItem *, taglist, a3, \
  245.     , RENDER_BASE_NAME)
  246.  
  247. #ifndef NO_INLINE_STDARG
  248. #define MapRGBArray(engine, rgb, width, height, chunky, tags...) \
  249.     ({ULONG _tags[] = {tags}; MapRGBArrayA((engine), (rgb), (width), (height), (chunky), (struct TagItem *) _tags);})
  250. #endif
  251.  
  252. #define RGBArrayDiversityA(rgb, width, height, taglist) \
  253.     LP4(0x108, LONG, RGBArrayDiversityA, ULONG *, rgb, a0, UWORD, width, d0, UWORD, height, d1, struct TagItem *, taglist, a1, \
  254.     , RENDER_BASE_NAME)
  255.  
  256. #ifndef NO_INLINE_STDARG
  257. #define RGBArrayDiversity(rgb, width, height, tags...) \
  258.     ({ULONG _tags[] = {tags}; RGBArrayDiversityA((rgb), (width), (height), (struct TagItem *) _tags);})
  259. #endif
  260.  
  261. #define ChunkyArrayDiversityA(chunky, palette, width, height, taglist) \
  262.     LP5(0x10e, LONG, ChunkyArrayDiversityA, UBYTE *, chunky, a0, APTR, palette, a1, UWORD, width, d0, UWORD, height, d1, struct TagItem *, taglist, a2, \
  263.     , RENDER_BASE_NAME)
  264.  
  265. #ifndef NO_INLINE_STDARG
  266. #define ChunkyArrayDiversity(chunky, palette, width, height, tags...) \
  267.     ({ULONG _tags[] = {tags}; ChunkyArrayDiversityA((chunky), (palette), (width), (height), (struct TagItem *) _tags);})
  268. #endif
  269.  
  270. #define MapChunkyArrayA(engine, source, palette, width, height, dest, taglist) \
  271.     LP7A4(0x114, ULONG, MapChunkyArrayA, APTR, engine, a0, UBYTE *, source, a1, APTR, palette, a2, UWORD, width, d0, UWORD, height, d1, UBYTE *, dest, a3, struct TagItem *, taglist, d7, \
  272.     , RENDER_BASE_NAME)
  273.  
  274. #ifndef NO_INLINE_STDARG
  275. #define MapChunkyArray(engine, source, palette, width, height, dest, tags...) \
  276.     ({ULONG _tags[] = {tags}; MapChunkyArrayA((engine), (source), (palette), (width), (height), (dest), (struct TagItem *) _tags);})
  277. #endif
  278.  
  279. #define InsertAlphaChannelA(maskarray, width, height, rgbarray, taglist) \
  280.     LP5NR(0x11a, InsertAlphaChannelA, UBYTE *, maskarray, a0, UWORD, width, d0, UWORD, height, d1, ULONG *, rgbarray, a1, struct TagItem *, taglist, a2, \
  281.     , RENDER_BASE_NAME)
  282.  
  283. #ifndef NO_INLINE_STDARG
  284. #define InsertAlphaChannel(maskarray, width, height, rgbarray, tags...) \
  285.     ({ULONG _tags[] = {tags}; InsertAlphaChannelA((maskarray), (width), (height), (rgbarray), (struct TagItem *) _tags);})
  286. #endif
  287.  
  288. #define ExtractAlphaChannelA(rgbarray, width, height, chunkyarray, taglist) \
  289.     LP5NR(0x120, ExtractAlphaChannelA, ULONG *, rgbarray, a0, UWORD, width, d0, UWORD, height, d1, UBYTE *, chunkyarray, a1, struct TagItem *, taglist, a2, \
  290.     , RENDER_BASE_NAME)
  291.  
  292. #ifndef NO_INLINE_STDARG
  293. #define ExtractAlphaChannel(rgbarray, width, height, chunkyarray, tags...) \
  294.     ({ULONG _tags[] = {tags}; ExtractAlphaChannelA((rgbarray), (width), (height), (chunkyarray), (struct TagItem *) _tags);})
  295. #endif
  296.  
  297. #define ApplyAlphaChannelA(sourcearray, width, height, destarray, taglist) \
  298.     LP5NR(0x126, ApplyAlphaChannelA, ULONG *, sourcearray, a0, UWORD, width, d0, UWORD, height, d1, ULONG *, destarray, a1, struct TagItem *, taglist, a2, \
  299.     , RENDER_BASE_NAME)
  300.  
  301. #ifndef NO_INLINE_STDARG
  302. #define ApplyAlphaChannel(sourcearray, width, height, destarray, tags...) \
  303.     ({ULONG _tags[] = {tags}; ApplyAlphaChannelA((sourcearray), (width), (height), (destarray), (struct TagItem *) _tags);})
  304. #endif
  305.  
  306. #define MixRGBArrayA(sourcearray, width, height, destarray, ratio, taglist) \
  307.     LP6NR(0x12c, MixRGBArrayA, ULONG *, sourcearray, a0, UWORD, width, d0, UWORD, height, d1, ULONG *, destarray, a1, UWORD, ratio, d2, struct TagItem *, taglist, a2, \
  308.     , RENDER_BASE_NAME)
  309.  
  310. #ifndef NO_INLINE_STDARG
  311. #define MixRGBArray(sourcearray, width, height, destarray, ratio, tags...) \
  312.     ({ULONG _tags[] = {tags}; MixRGBArrayA((sourcearray), (width), (height), (destarray), (ratio), (struct TagItem *) _tags);})
  313. #endif
  314.  
  315. #define AllocRenderVecClear(rendermemhandler, size) \
  316.     LP2(0x132, APTR, AllocRenderVecClear, APTR, rendermemhandler, a0, ULONG, size, d0, \
  317.     , RENDER_BASE_NAME)
  318.  
  319. #define CreateAlphaArrayA(rgbarray, width, height, taglist) \
  320.     LP4NR(0x138, CreateAlphaArrayA, ULONG *, rgbarray, a0, UWORD, width, d0, UWORD, height, d1, struct TagItem *, taglist, a1, \
  321.     , RENDER_BASE_NAME)
  322.  
  323. #ifndef NO_INLINE_STDARG
  324. #define CreateAlphaArray(rgbarray, width, height, tags...) \
  325.     ({ULONG _tags[] = {tags}; CreateAlphaArrayA((rgbarray), (width), (height), (struct TagItem *) _tags);})
  326. #endif
  327.  
  328. #define MixAlphaChannelA(source1, source2, width, height, dest, taglist) \
  329.     LP6NR(0x13e, MixAlphaChannelA, ULONG *, source1, a0, ULONG *, source2, a1, UWORD, width, d0, UWORD, height, d1, ULONG *, dest, a2, struct TagItem *, taglist, a3, \
  330.     , RENDER_BASE_NAME)
  331.  
  332. #ifndef NO_INLINE_STDARG
  333. #define MixAlphaChannel(source1, source2, width, height, dest, tags...) \
  334.     ({ULONG _tags[] = {tags}; MixAlphaChannelA((source1), (source2), (width), (height), (dest), (struct TagItem *) _tags);})
  335. #endif
  336.  
  337. #define TintRGBArrayA(source, width, height, RGB, ratio, dest, taglist) \
  338.     LP7NR(0x144, TintRGBArrayA, ULONG *, source, a0, UWORD, width, d0, UWORD, height, d1, ULONG, RGB, d2, UWORD, ratio, d3, ULONG *, dest, a1, struct TagItem *, taglist, a2, \
  339.     , RENDER_BASE_NAME)
  340.  
  341. #ifndef NO_INLINE_STDARG
  342. #define TintRGBArray(source, width, height, RGB, ratio, dest, tags...) \
  343.     ({ULONG _tags[] = {tags}; TintRGBArrayA((source), (width), (height), (RGB), (ratio), (dest), (struct TagItem *) _tags);})
  344. #endif
  345.  
  346. #endif /*  _INLINE_RENDER_H  */
  347.